//
//  BaseObject.h
//  Demo
//
//  Created by CG on 13-10-13.
//
//

#ifndef Demo_BaseObject_h
#define Demo_BaseObject_h

#include "Utils.h"
#include "cocos2d.h"
#include "Box2d.h"

using namespace cocos2d;

class BaseObject : public CCNode
{
public:
    BaseObject();
    virtual ~BaseObject();
    
    virtual void initWithFileAndType(const char *pszFileName, ObjectType objType) = 0;
    virtual void CreateBody(b2World* pWorld) = 0;
    
    
    virtual void SetObjectPosition(const cocos2d::CCPoint& position) = 0;
    virtual void SetObjectScale(const float scale) = 0;
    virtual void SetObjectRotation(const float fRotation) = 0;
    
    virtual void PlayCollisionEffect();
    
    
    inline int GetObjectType();
    inline void SetObjectClassification(ObjectClassification classification);
    inline int GetObjectClassification();
    
    inline b2Body* GetBody();
    
protected:
    int m_objectType; //blue. red. orange or ....
    
    int m_objectClassification;//ball, bucket, obstacle .....
    
    b2Body* m_pBody;
};


inline int BaseObject::GetObjectType()
{
    return m_objectType;
}
inline void BaseObject::SetObjectClassification(ObjectClassification classification)
{
    m_objectClassification = classification;
}
inline int BaseObject::GetObjectClassification()
{
    return m_objectClassification;
}

inline b2Body* BaseObject::GetBody()
{
    return m_pBody;
}
#endif

